<!doctype html>
<html lang="zh-CN">
<head>
<title>兼职招聘系统-后台首页</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="shortcut icon" href="../images/logo.png" type="image/x-icon" />
</head>
<body>
	<div class="top">
		<div id="top_t">
			<div class="fl">
				<img src="../images/logo02.png" alt="衡阳市南华大学船山学院17级软件2班邓强">
			</div>
			<div id="photo_info" class="fr">
				<div id="photo" class="fl">
					<a href="#"><img src="../images/logo.png"alt="衡阳市南华大学船山学院17级软件2班邓强" width="60" height="60"></a>
				</div>
				<div id="base_info" class="fr">
					<div class="help_info">
						<a href="1" id="hp">&nbsp;</a> <a href="2" id="gy">&nbsp;</a>
						<a href="../../login/adminloginout" id="out">&nbsp;</a>
					</div>
					<div class="info_center" id="em">请先登录</div>
				</div>
			</div>
		</div>
		<div id="side_here">
			<div id="side_here_l" class="fl"></div>
			<div id="here_area" class="fl">当前位置：欢迎界面</div>
		</div>
	</div>
	<div class="side">
		<div class="sideMenu" id="sideMenu" style="margin: 0 auto">
			<h3>用户信息管理</h3>
			<ul>
				<li><a href="javascript:void(0)" onclick="showpage(this,'addadmin.html')">添加管理员</a></li>
				<li><a href="javascript:void(0)" onclick="showpage(this,'viewadmin.html')">管理员信息</a></li>
				<li><a href="javascript:void(0)" onclick="showpage(this,'jober.html')">求职者信息</a></li>
				<li><a href="javascript:void(0)" onclick="showpage(this,'company.html')">企业信息</a></li>
			</ul>
			<h3>职位信息管理</h3>
			<ul>
				<li><a href="javascript:void(0)" onclick="showpage(this,'type.html')">职位类型</a></li>
				<li><a href="javascript:void(0)" onclick="showpage(this,'viewpositions.html')">浏览职位</a></li>
			</ul>
		</div>
	</div>
	<div class="main">
		<iframe name="right" id="rightMain" src="welcome.html" frameborder="no" scrolling="auto" width="100%" height="auto" allowtransparency="true"></iframe>
	</div>
	<div class="bottom">
		<div id="bottom_bg">
			<a class="copy" href="">衡阳市南华大学船山学院17级软件2班邓强</a>&copy;版权所有
			1787-3443012
		</div>
	</div>
	<div class="scroll">
		<a href="javascript:;" class="per" title="使用鼠标滚轴滚动侧栏"
			onclick="menuScroll(1);"></a> <a href="javascript:;" class="next"
			title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(2);"></a>
	</div>
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript" src="../js/jquery.SuperSlide.js"></script>
	<script type="text/javascript" src="../../js/qs.js"></script>
	<script type="text/javascript" src="../../js/vue.js"></script>
	<script type="text/javascript" src="../../js/axios.js"></script>
	<script src="/../../js/websocket.js"></script>
	<script type="text/javascript">
    $(function(){
    	adminCheck();
    	
        $(".sideMenu").slide({
            titCell:"h3",
            targetCell:"ul",
            defaultIndex:0,
            effect:'slideDown',
            delayTime:'500' ,
            trigger:'click',
            triggerTime:'150',
            defaultPlay:true,
            returnDefault:false,
            easing:'easeInQuint',
            endFun:function(){
                scrollWW();
            }
        });
        $(window).resize(function() {
            scrollWW();
        });
    });
    
	//获取用户名
	function getnickname(){
		$.post("../../login/getadminnickname", {}, function(data) {
			//用户昵称
			console.log("当前登录的用户名为：" + data.aname);
			$("#em").text("管理员："+data.aname);
		}, "json");
	}
	
	//下线
	function loginout(){
		$.post("../../login/adminloginout", {}, function(data) {
			console.log("下线了...");
		}, "text");
		window.location.reload();
	}
	
	function adminCheck(){
			//先发送请求获取登录用户id
			$.get("../../login/adminCheck", null, function(data){
			if (data.code == 500) {
				console.log("请先登录...");
				alert("请先登录...");
				$("#em").text("你好！请先登录...");
				location.href="../index.html";
				return;
			}
		
			if (data.code == 200) {
				//连上 websocket服务器
				openWebSocket(data.msg);
				getnickname();
			}
		},"json");
	}
    
    
    
    
    
    
    
    
    
    
    function scrollWW(){
        if($(".side").height()<$(".sideMenu").height()){
            $(".scroll").show();
            var pos = $(".sideMenu ul:visible").position().top-38;
            $('.sideMenu').animate({top:-pos});
        }else{
            $(".scroll").hide();
            $('.sideMenu').animate({top:0});
            n=1;
        }
    }

    var n=1;
    function menuScroll(num){
        var Scroll = $('.sideMenu');
        var ScrollP = $('.sideMenu').position();
        if(num==1){
            Scroll.animate({top:ScrollP.top-38});
            n = n+1;
        }else{
            if (ScrollP.top > -38 && ScrollP.top != 0) { ScrollP.top = -38; }
            if (ScrollP.top<0) {
                Scroll.animate({top:38+ScrollP.top});
            }else{
                n=1;
            }
            if(n>1){
                n = n-1;
            }
        }
    }

    function showpage(obj,page){
        $("#rightMain").attr("src",page);
        $("#sideMenu li").removeClass("on");
        $(obj).parent().addClass("on");
        $("#here_area").text("当前位置："+$(obj).text());
    }
</script>
</body>
</html>
